package com.horse.pack.common;

import lombok.Data;

/**
 * @author yangliu
 * @date 2024/3/22 11:39 AM
 */
@Data
public class GeneralResponse<T> extends BaseResponse {
    private T data;

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    GeneralResponse(int code, T data) {
        super(code);
        this.data = data;
    }

    GeneralResponse(int code) {
        super(code);
    }

    public static <T> GeneralResponse<T> success(T data) {
        return new GeneralResponse<>(0, data);
    }

    public static <T> GeneralResponse<T> success() {
        return new GeneralResponse<>(0);
    }
}
